#!/usr/bin/env bash
################################################################################
# oscar - output the NATO phonetic alphabet reference                          #
#                                                                              #
# @author    David Christian Liedle <david.liedle@gmail.com>                   #
# @copyright Copyright (c) 2009-2011 David Christian Liedle                    #
# @license   MIT Open Source License / CC-BY 3.0                               #
#             http://www.opensource.org/licenses/mit-license.php               #
#              http://creativecommons.org/licenses/by/3.0/                     #
#                                                                              #
#  Released as part of The CLIMAX/Candy Suite: http://climax.googlecode.com/   #
#                                                                              #
################################################################################
# USAGE
#
# Options:  -A across
#           -D down
#           -T tall
#
# DEVELOPMENT HISTORY
# version 2008.08.04 - 1.0
# updated 2008.09.15 - 1.1
# updated 2008.09.16 - 1.2
# updated 2009.01.26 - 1.3
#
# REFERENCE
# List of "mappings"
# Alpha  . Bravo . Charlie . Delta  . Echo     . Foxtrot . Golf . Hotel  . India
# Juliet . Kilo  . Lima    . Mike   . November . Oscar   . Papa . Quebec . Romeo
# Sierra . Tango . Uniform . Victor . Whiskey  . X-ray   . Yankee        . Zulu
#
# DEDICATION
# This program is dedicated to the memory of Oscar Tiscareño of Anaheim, CA.
################################################################################

OSCAR_VERSION="1.3.0"
OSCAR_DATE="2002.01.26"

################################################################################
# Setup functions for program flow:

function mainLoop {
    
    local myInput=FALSE
    echo -n ">>> "
    read myInput
    if [ "$myInput" = "a" ]; then
        dotsAcross
    fi
    echo $myInput
    
}

################################################################################
# Setup functions for output:

function titleScreen {
    echo
    echo ". . . . . . . . . . . . . . ."
    echo ". Oscar $OSCAR_VERSION :: $OSCAR_DATE ."
    echo ". . . . . . . . . . . . . . ."
}

function dotsAcross {
    
    echo "
................................................................................
Alpha  . Bravo . Charlie . Delta  . Echo     . Foxtrot . Golf   . Hotel  . India
Juliet . Kilo  . Lima    . Mike   . November . Oscar   . Papa   . Quebec . Romeo
Sierra . Tango . Uniform . Victor . Whiskey  . X-ray   . Yankee . Zulu
................................................................................
"

}

function dotsDown {
    echo "
................................................................................
. Alpha   . Echo    . India  . Mike     . Quebec . Uniform . Sierra  . Whiskey .
. Bravo   . Foxtrot . Juliet . November . Romeo  . Victor  . Tango   . X-ray   .
. Charlie . Golf    . Kilo   . Oscar    . Sierra . Whiskey . Uniform . Yankee  .
. Delta   . Hotel   . Lima   . Papa     . Tango  . X-ray   . Victor  . Zulu    .
................................................................................
"

}

function dotsTall {

    echo "
................
. A . Alpha    .
. B . Bravo    .
. C . Charlie  .
. D . Delta    .
. E . Echo     .
. F . Foxtrot  .
. G . Golf     .
. H . Hotel    .
. I . India    .
. J . Juliet   .
. K . Kilo     .
. L . Lima     .
. M . Mike     .
. N . November .
. O . Oscar    .
. P . Papa     .
. Q . Quebec   .
. R . Romeo    .
. S . Sierra   .
. T . Tango    .
. U . Uniform  .
. V . Victor   .
. W . Whiskey  .
. X . X-ray    .
. Y . Yankee   .
. Z . Zulu     .
................
"

}


################################################################################
# Evaluate flags from the command line:

# if -A, dotsAcross
# if -D, dotsDown
# if -T, dotsTall

################################################################################
# BEGIN OUTPUT:

titleScreen
dotsDown
#mainLoop

################################################################################
#Ideas:
# echo the name per key press
# translate a string into letter names
# echo across, down, and straight list
# wire it in with mac's "say" command to speak strings
